{
 "cells": [
  {
   "cell_type": "code",
   "execution_count": 1,
   "metadata": {},
   "outputs": [],
   "source": [
    "# Importing the function from the related python file\n",
    "import SplitExtension as SE"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 2,
   "metadata": {},
   "outputs": [],
   "source": [
    "# Listing the source names for which the fits cubes will be split\n",
    "SourceNameList = ['Fil1', 'Fil2', 'Fil4', 'Fil5', 'Fil6', 'Fil8', 'Fil10', 'G24', 'G47', 'G49']\n",
    "CoordHAWC = 'Gal' # Choices are 'RA' , 'Gal' , or 'Original' "
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 3,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "===\n",
      "Source Name: Fil1\n",
      "Reference Frame: Gal\n",
      "Input Fits File: Fil1/Fil1_Gal.fits\n",
      "Output Folder : Fil1/Divided/\n",
      "Dividing the HAWC+ cube for Fil1\n",
      "===\n",
      "Source Name: Fil2\n",
      "Reference Frame: Gal\n",
      "Input Fits File: Fil2/Fil2_Gal.fits\n",
      "Output Folder : Fil2/Divided/\n",
      "Dividing the HAWC+ cube for Fil2\n",
      "===\n",
      "Source Name: Fil4\n",
      "Reference Frame: Gal\n",
      "Input Fits File: Fil4/Fil4_Gal.fits\n",
      "Output Folder : Fil4/Divided/\n",
      "Dividing the HAWC+ cube for Fil4\n",
      "===\n",
      "Source Name: Fil5\n",
      "Reference Frame: Gal\n",
      "Input Fits File: Fil5/Fil5_Gal.fits\n",
      "Output Folder : Fil5/Divided/\n",
      "Dividing the HAWC+ cube for Fil5\n",
      "===\n",
      "Source Name: Fil6\n",
      "Reference Frame: Gal\n",
      "Input Fits File: Fil6/Fil6_Gal.fits\n",
      "Output Folder : Fil6/Divided/\n",
      "Dividing the HAWC+ cube for Fil6\n",
      "===\n",
      "Source Name: Fil8\n",
      "Reference Frame: Gal\n",
      "Input Fits File: Fil8/Fil8_Gal.fits\n",
      "Output Folder : Fil8/Divided/\n",
      "Dividing the HAWC+ cube for Fil8\n",
      "===\n",
      "Source Name: Fil10\n",
      "Reference Frame: Gal\n",
      "Input Fits File: Fil10/Fil10_Gal.fits\n",
      "Output Folder : Fil10/Divided/\n",
      "Dividing the HAWC+ cube for Fil10\n",
      "===\n",
      "Source Name: G24\n",
      "Reference Frame: Gal\n",
      "Input Fits File: G24/G24_Gal.fits\n",
      "Output Folder : G24/Divided/\n",
      "Dividing the HAWC+ cube for G24\n",
      "===\n",
      "Source Name: G47\n",
      "Reference Frame: Gal\n",
      "Input Fits File: G47/G47_Gal.fits\n",
      "Output Folder : G47/Divided/\n",
      "Dividing the HAWC+ cube for G47\n",
      "===\n",
      "Source Name: G49\n",
      "Reference Frame: Gal\n",
      "Input Fits File: G49/G49_Gal.fits\n",
      "Output Folder : G49/Divided/\n",
      "Dividing the HAWC+ cube for G49\n"
     ]
    }
   ],
   "source": [
    "# Dividing the HAWC+ cube for every source\n",
    "for i in range (0, len(SourceNameList)):\n",
    "    # General information about the source\n",
    "    print('===')\n",
    "    print('Source Name: '+SourceNameList[i])\n",
    "    print('Reference Frame: '+CoordHAWC)\n",
    "    FitsFile = SourceNameList[i] + '/' + SourceNameList[i] + '_' + CoordHAWC + '.fits'\n",
    "    print('Input Fits File: ' + FitsFile)\n",
    "    OutFolder = SourceNameList[i] + '/Divided/'\n",
    "    print('Output Folder : ' + OutFolder)\n",
    "    # Splitting the FITS file extensions into individual files\n",
    "    SE.SplitHAWC(SourceNameList[i],FitsFile,OutFolder,CoordHAWC)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "# Dividing the Planck cube for every source\n",
    "for i in range (0, len(SourceNameList)):\n",
    "    # General information about the source\n",
    "    print('===')\n",
    "    print('Source Name: '+SourceNameList[i])\n",
    "    print('Reference Frame: Planck Galactic')\n",
    "    FitsFile = SourceNameList[i] + '/' + SourceNameList[i] + '_Planck.fits'\n",
    "    print('Input Fits File: ' + FitsFile)\n",
    "    OutFolder = SourceNameList[i] + '/Divided/'\n",
    "    print('Output Folder : ' + OutFolder)\n",
    "    # Splitting the FITS file extensions into individual files\n",
    "    SE.SplitHAWC(SourceNameList[i],FitsFile,OutFolder,CoordHAWC)"
   ]
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "PoLiteWIP",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.10.8"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 2
}
